<!-- Webboard Template : Post a new topic -->
{capture name=path}
		{if $post_action == 'BOARD'}
			<a href="{$back}">
			{l s='Webboard'}
			</a>
		{elseif $post_action == 'TOPIC'}
			<a href="webboard.php">
			{l s='Webboard'}
			</a>
			<span class="navigation-pipe">{$navigationPipe}</span>
			<a href="{$back}">
				{$topic_title|escape:'htmlall'|stripslashes|truncate:30}
			</a>
		{/if}
	<span class="navigation-pipe">{$navigationPipe}</span>
	{if $post_action == 'BOARD'}
		{l s='New Topic'}
	{elseif $post_action == 'TOPIC'}
		{l s='Reply'}
	{/if}	
{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}

<!-- markItUp! -->
<script type="text/javascript" src="{$content_dir}js/jquery/markitupeditor/markitup/jquery.markitup.pack.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="{$content_dir}js/jquery/markitupeditor/markitup/sets/bbcode/set.js"></script>
<!-- markItUp! skin -->
<link rel="stylesheet" type="text/css" href="{$content_dir}js/jquery/markitupeditor/markitup/skins/markitup/style.css" />
<!--  markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="{$content_dir}js/jquery/markitupeditor/markitup/sets/bbcode/style.css" />
{literal}
<script type="text/javascript">
//use jQuery 1.2.6 default
$(document).ready(function() {
	$('#bb-editor').markItUp(mySettings);
			
});
//Check length of input text inside textarea
function imposeMaxLength( object, maxChars)
{
	var len = object.value.length;
    if (len >= maxChars) {
    	object.value = object.value.substring(0, maxChars);
    }
    $('#word_left').text(( maxChars - len ) < 0 ? 0 :( maxChars - len ) );
}
</script>
{/literal}
<div id="my-webboard">
	{if $post_action == 'BOARD'}
	<h4 class="editor_header_new_topic">
	{elseif $post_action == 'TOPIC'}
	<h4 class="editor_header_reply">
	{/if}	
		<span></span>
	</h4>
	<form id="post-msg-form" action="webboard.php" method="post">
	<fieldset>
		<input type="hidden" name="action" value="submit_post" />
		<input type="hidden" name="post_action" value="{$post_action}" />
		<input type="hidden" name="back" value="{$back}" />
		{if $post_action == 'BOARD'}
		<input type="hidden" name="topic_id" value="0" />
		{else}
		<input type="hidden" name="topic_id" value="{$topic_id}" />
		{/if}
		 
		<p>
			<label for="topic_title">Topic<span class="required_field_marker">*<span></label>
			<span>
				{if $post_action == 'BOARD'}
				<input id="topic_title" name="topic_title" maxlength="100" value="{if isset($smarty.post.topic_title)}{$smarty.post.topic_title|escape:'htmlall'|stripslashes}{/if}" type="text" size="65">
				{elseif $post_action == 'TOPIC'}
				<input type="text" id="topic_title" disabled="disabled" value="{$topic_title|escape:'htmlall'|stripslashes|truncate:30}" size="65"/> 
				{/if}
			</span>
		</p>
		<p>
			<label for="bb-editor">Message<span class="required_field_marker">*<span></label>
			<span>
				<span id="word_count_panel" style="padding-left: 10px;color:white"><span id="word_left">1000</span> words left ( Maximum 1000 ).</span>
				<textarea id="bb-editor" name="topic_content" cols="80" rows="20" onkeyup="imposeMaxLength(this, 1000);">{if isset($smarty.post.topic_content)}{$smarty.post.topic_content|escape:'htmlall'|stripslashes}{/if}</textarea>
			</span>
		</p>
		<p>
			<label for="display_name">Posted by</label>
			<span>
				<input id="display_name" name="author" maxlength="10" value="{if isset($smarty.post.author)}{$smarty.post.author|escape:'htmlall'|stripslashes}{/if}" type="text" size="28">
				<span class="field_desc" style="color:white">Note: Logged-in user can left this blank.</span> 
			</span>
		</p>
		<p>
			<label style="float: left;padding-right: 5px">Validation Code<span class="required_field_marker">*<span></label>
			<div style="float: left;">
				<img id="captcha" src="/tools/phpcaptcha/securimage_show_me.php" alt="CAPTCHA Image" />
				<div>
					<a href="#" onclick="document.getElementById('captcha').src = '/tools/phpcaptcha/securimage_show_me.php?' + Math.random(); return false"><img id="captcha" src="/tools/phpcaptcha/images/refresh.png" alt="Reload" title="Reload Image"/></a>
					<input type="text" id="captcha_code" name="captcha_code" size="16" maxlength="6" />
				</div>
			</div>
		</p>
		<p style="clear: both;padding-top: 10px">
			<input type="submit" value="           " class="submit_post_button" />
		</p>
	</fieldset>
	</form>
	<div class="footer">
	</div>
</div>